<?php
/**
* @version		$Id:orders.php  1 2013-11-05 20:17:56Z  $
* @package		Cash_user
* @subpackage 	Tables
* @copyright	Copyright (C) 2013, . All rights reserved.
* @license #
*/

// no direct access
defined('_JEXEC') or die('Restricted access');

/**
* Jimtawl TableOrders class
*
* @package		Cash_user
* @subpackage	Tables
*/
class TableOrders extends JTable
{
	
   /** @var int virtuemart_order_id- Primary Key  **/
   public $virtuemart_order_id = null;

   /** @var varchar order_billTax  **/
   public $order_billTax = null;

   /** @var int created_by  **/
   public $created_by = null;

   /** @var int modified_by  **/
   public $modified_by = null;

   /** @var int unsigned virtuemart_user_id  **/
   public $virtuemart_user_id = null;

   /** @var smallint unsigned virtuemart_vendor_id  **/
   public $virtuemart_vendor_id = null;

   /** @var char order_number  **/
   public $order_number = null;

   /** @var char customer_number  **/
   public $customer_number = null;

   /** @var char order_pass  **/
   public $order_pass = null;

   /** @var decimal order_total  **/
   public $order_total = "0.00000";

   /** @var decimal order_salesPrice  **/
   public $order_salesPrice = "0.00000";

   /** @var decimal order_billTaxAmount  **/
   public $order_billTaxAmount = "0.00000";

   /** @var decimal order_billDiscountAmount  **/
   public $order_billDiscountAmount = "0.00000";

   /** @var decimal order_discountAmount  **/
   public $order_discountAmount = "0.00000";

   /** @var decimal order_subtotal  **/
   public $order_subtotal = null;

   /** @var decimal order_tax  **/
   public $order_tax = null;

   /** @var decimal order_shipment  **/
   public $order_shipment = null;

   /** @var decimal order_shipment_tax  **/
   public $order_shipment_tax = null;

   /** @var decimal order_payment  **/
   public $order_payment = null;

   /** @var decimal order_payment_tax  **/
   public $order_payment_tax = null;

   /** @var decimal coupon_discount  **/
   public $coupon_discount = "0.00";

   /** @var char coupon_code  **/
   public $coupon_code = null;

   /** @var decimal order_discount  **/
   public $order_discount = "0.00";

   /** @var smallint order_currency  **/
   public $order_currency = null;

   /** @var char order_status  **/
   public $order_status = null;

   /** @var smallint user_currency_id  **/
   public $user_currency_id = null;

   /** @var decimal user_currency_rate  **/
   public $user_currency_rate = "1.00000";

   /** @var mediumint unsigned virtuemart_paymentmethod_id  **/
   public $virtuemart_paymentmethod_id = null;

   /** @var mediumint unsigned virtuemart_shipmentmethod_id  **/
   public $virtuemart_shipmentmethod_id = null;

   /** @var varchar customer_note  **/
   public $customer_note = null;

   /** @var char order_language  **/
   public $order_language = null;

   /** @var char ip_address  **/
   public $ip_address = null;

   /** @var datetime created_on  **/
   public $created_on = "0000-00-00 00:00:00";

   /** @var datetime modified_on  **/
   public $modified_on = "0000-00-00 00:00:00";

   /** @var datetime locked_on  **/
   public $locked_on = "0000-00-00 00:00:00";

   /** @var int locked_by  **/
   public $locked_by = null;




	/**
	 * Constructor
	 *
	 * @param object Database connector object
	 * @since 1.0
	 */
	public function __construct(& $db) 
	{
		parent::__construct('#__virtuemart_orders', 'virtuemart_order_id', $db);
	}

	/**
	* Overloaded bind function
	*
	* @acces public
	* @param array $hash named array
	* @return null|string	null is operation was satisfactory, otherwise returns an error
	* @see JTable:bind
	* @since 1.5
	*/
	public function bind($array, $ignore = '')
	{ 
		
		return parent::bind($array, $ignore);		
	}

	/**
	 * Overloaded check method to ensure data integrity
	 *
	 * @access public
	 * @return boolean True on success
	 * @since 1.0
	 */
	public function check()
	{



		/** check for valid name */
		/**
		if (trim($this->order_billTax) == '') {
			$this->setError(JText::_('Your Orders must contain a order_billTax.')); 
			return false;
		}
		**/		

		return true;
	}
}
